# files/urls.py
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import FileViewSet, upload_file_view  # 导入函数视图

router = DefaultRouter()
router.register(r'files', FileViewSet, basename='file')  # 视图集路由（API接口）

urlpatterns = [
    path('', include(router.urls)),  # API接口路由（如/api/files/）
    path('upload/', upload_file_view, name='file-upload'),  # 函数视图路由（如/api/upload/，用于页面访问）
]